<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function desc(x,y)
{
	return y-x;
}
function asc(x,y)
{
	return x-y;
}
	
var A =new Array(6,2,4,3,5,1);
var b,c;
document.write("A的原序列为：");
for(n in A){
	document.write(A[n]," ");
}
document.write("<br>"); 
A.sort(desc);
document.write("对A进行降序排列：");
for(n in A){
	document.write(A[n]," ");
}
document.write("<br>"); 
A.sort(asc);
document.write("对A进行升序排列：");
for(n in A){
	document.write(A[n]," ");
}
document.write("<br>"); 
delete A[2];
document.write("删除A的第三个元素后");
for(n in A){
	document.write(A[n]," ");
}
document.write("<br>"); 
document.write("此时A的长度为：",A.length,"<br>");
b=A.toString();
c=A.join("@#$");
document.write(b,"<br>",c,"<br>");
A.reverse();
document.write("反转后A为：");
for(n in A){
	document.write(A[n]," ");
}

</script>
</head>

<body>
</body>
</html>
